package com.winit.schedule.job.tracker.web.controller;

import com.winit.schedule.core.utils.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by jianke.zhang on 2017/3/21.
 */
public class BaseController {


    protected Map<String, Object> buildMesssage(String errorMsg) {
        Map<String, Object> reMsg = new HashMap<String, Object>();
        if (StringUtils.isBlank(errorMsg)) {
            reMsg.put("success", true);
            reMsg.put("message", "The success of the operation");
        } else {
            reMsg.put("success", false);
            reMsg.put("message", errorMsg);
        }
        return reMsg;
    }
}
